<script setup></script>

<template>
  <!-- 主要内容 -->
  <div class="container main-content">
    <div class="content-grid">
      <!-- 左侧内容区 -->
      <div>
        <!-- 面包屑导航 -->
        <div class="breadcrumb">
          <ol class="breadcrumb-list">
            <li class="breadcrumb-item">
              <a href="wiki.html" class="breadcrumb-link">资料库</a>
            </li>
            <li class="breadcrumb-item">
              <span class="breadcrumb-separator">/</span>
              <span class="breadcrumb-link">作物</span>
            </li>
          </ol>
        </div>
        <!-- 筛选器 -->
        <div class="filter-card">
          <div class="filter-content">
            <div class="filter-grid">
              <div class="filter-group">
                <label for="season">季节</label>
                <select id="season" class="filter-select">
                  <option value="">全部季节</option>
                  <option value="spring">春季</option>
                  <option value="summer">夏季</option>
                  <option value="fall">秋季</option>
                  <option value="winter">冬季</option>
                </select>
              </div>
              <div class="filter-group">
                <label for="type">类型</label>
                <select id="type" class="filter-select">
                  <option value="">全部类型</option>
                  <option value="vegetable">蔬菜</option>
                  <option value="fruit">水果</option>
                  <option value="flower">花卉</option>
                </select>
              </div>
              <div class="filter-group">
                <label for="sort">排序</label>
                <select id="sort" class="filter-select">
                  <option value="name">名称</option>
                  <option value="price">价格</option>
                  <option value="growth">生长时间</option>
                </select>
              </div>
            </div>
          </div>
        </div>
        <!-- 作物列表 -->
        <div class="crop-section">
          <h2 class="section-title">春季作物</h2>
          <div class="crop-grid">
            <!-- 草莓 -->
            <router-link to="/wiki/details" class="crop-card">
              <div class="crop-content">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="草莓"
                  class="crop-image"
                />
                <h3 class="crop-title">草莓</h3>
                <div class="crop-details">
                  <span>生长时间：8天</span>
                  <span>售价：120金币</span>
                </div>
                <span class="crop-tag tag-fruit">水果</span>
              </div>
            </router-link>
            <!-- 土豆 -->
            <a href="#" class="crop-card">
              <div class="crop-content">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="土豆"
                  class="crop-image"
                />
                <h3 class="crop-title">土豆</h3>
                <div class="crop-details">
                  <span>生长时间：6天</span>
                  <span>售价：80金币</span>
                </div>
                <span class="crop-tag tag-vegetable">蔬菜</span>
              </div>
            </a>
            <!-- 花椰菜 -->
            <a href="#" class="crop-card">
              <div class="crop-content">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="花椰菜"
                  class="crop-image"
                />
                <h3 class="crop-title">花椰菜</h3>
                <div class="crop-details">
                  <span>生长时间：12天</span>
                  <span>售价：175金币</span>
                </div>
                <span class="crop-tag tag-vegetable">蔬菜</span>
              </div>
            </a>
          </div>
        </div>
        <div class="crop-section">
          <h2 class="section-title">夏季作物</h2>
          <div class="crop-grid">
            <!-- 蓝莓 -->
            <a href="#" class="crop-card">
              <div class="crop-content">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="蓝莓"
                  class="crop-image"
                />
                <h3 class="crop-title">蓝莓</h3>
                <div class="crop-details">
                  <span>生长时间：13天</span>
                  <span>售价：150金币</span>
                </div>
                <span class="crop-tag tag-fruit">水果</span>
              </div>
            </a>
            <!-- 辣椒 -->
            <a href="#" class="crop-card">
              <div class="crop-content">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="辣椒"
                  class="crop-image"
                />
                <h3 class="crop-title">辣椒</h3>
                <div class="crop-details">
                  <span>生长时间：5天</span>
                  <span>售价：60金币</span>
                </div>
                <span class="crop-tag tag-vegetable">蔬菜</span>
              </div>
            </a>
          </div>
        </div>
        <!-- 分页 -->
        <div class="pagination">
          <a href="#" class="pagination-link">上一页</a>
          <a href="#" class="pagination-link">1</a>
          <a href="#" class="pagination-link active">2</a>
          <a href="#" class="pagination-link">3</a>
          <a href="#" class="pagination-link">下一页</a>
        </div>
      </div>
      <!-- 右侧边栏 -->
      <div class="sidebar">
        <!-- 快速导航 -->
        <div class="sidebar-card">
          <div class="sidebar-content">
            <h3 class="sidebar-title">快速导航</h3>
            <div class="sidebar-list">
              <a href="#" class="sidebar-link">
                <span>春季作物</span>
                <span class="sidebar-count">12种</span>
              </a>
              <a href="#" class="sidebar-link">
                <span>夏季作物</span>
                <span class="sidebar-count">15种</span>
              </a>
              <a href="#" class="sidebar-link">
                <span>秋季作物</span>
                <span class="sidebar-count">10种</span>
              </a>
              <a href="#" class="sidebar-link">
                <span>冬季作物</span>
                <span class="sidebar-count">5种</span>
              </a>
            </div>
          </div>
        </div>
        <!-- 热门作物 -->
        <div class="sidebar-card">
          <div class="sidebar-content">
            <h3 class="sidebar-title">热门作物</h3>
            <div class="sidebar-list">
              <a href="#" class="hot-crop">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="远古水果"
                  class="hot-crop-image"
                />
                <div class="hot-crop-info">
                  <h4>远古水果</h4>
                  <p>最赚钱的作物</p>
                </div>
              </a>
              <a href="#" class="hot-crop">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="甜瓜"
                  class="hot-crop-image"
                />
                <div class="hot-crop-info">
                  <h4>甜瓜</h4>
                  <p>夏季高收益作物</p>
                </div>
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
body {
  font-family: "Noto Sans SC", sans-serif;
  background-color: #f9fafb;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
/* 导航栏 */
.navbar {
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
  padding: 0 1rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
}
.navbar-logo {
  height: 2rem;
  width: auto;
}
.navbar-title {
  margin-left: 0.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: #059669;
}
.navbar-nav {
  display: none;
}
.nav-link {
  color: #6b7280;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav-link.active,
.nav-link:focus {
  color: #111827;
  border-bottom-color: #059669;
}
.nav-link:hover {
  color: #374151;
  border-bottom-color: #d1d5db;
}
.login-btn {
  background-color: #059669;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.login-btn:hover {
  background-color: #047857;
}
/* 主体布局 */
.main-content {
  padding: 2rem 0;
}
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 2fr 1fr;
  }
  .sidebar {
    margin-top: 0;
  }
}
/* 面包屑导航 */
.breadcrumb {
  margin-bottom: 1.5rem;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
}
.breadcrumb-link {
  color: #6b7280;
  text-decoration: none;
}
.breadcrumb-link:hover {
  color: #374151;
}
.breadcrumb-separator {
  margin: 0 1rem;
  color: #9ca3af;
}
/* 筛选器 */
.filter-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.filter-content {
  padding: 1rem;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}
.filter-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
/* 作物列表 */
.crop-section {
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 1rem;
}
.crop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .crop-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1200px) {
  .crop-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.crop-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.2s;
}
.crop-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.crop-content {
  padding: 1rem;
}
.crop-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.crop-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
}
.crop-details {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.crop-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
}
.tag-fruit {
  background-color: #dcfce7;
  color: #166534;
}
.tag-vegetable {
  background-color: #dbeafe;
  color: #1e40af;
}
/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}
.pagination-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin: 0 2px;
  border-radius: 0.375rem;
}
.pagination-link.active {
  background-color: #ecfdf5;
  color: #059669;
}
.pagination-link:hover {
  background-color: #f9fafb;
}
/* 侧边栏 */
.sidebar {
  margin-top: 2rem;
}
.sidebar-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}
.sidebar-content {
  padding: 1.5rem;
}
.sidebar-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 1rem;
}
.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-link {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.sidebar-link:hover {
  color: #111827;
}
.sidebar-count {
  color: #9ca3af;
}
.hot-crop {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}
.hot-crop-image {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  object-fit: cover;
}
.hot-crop-info h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
}
.hot-crop-info p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}
/* 页脚 */
.footer {
  background-color: white;
  margin-top: 3rem;
  padding: 3rem 0;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -0.5rem -1.25rem;
}
.footer-link {
  padding: 0.5rem 1.25rem;
  color: #6b7280;
  text-decoration: none;
  font-size: 1rem;
}
.footer-link:hover {
  color: #111827;
}
.footer-copyright {
  text-align: center;
  color: #9ca3af;
  font-size: 1rem;
  margin-top: 2rem;
}
@media (min-width: 640px) {
  .navbar-nav {
    display: flex;
    gap: 2rem;
  }
}
</style>
